package com.pxxy.toturial.entity;

import java.io.Serializable;
import java.util.Objects;

/******************
 * @Author yejf
 * @Description TODO
 */
public class Host implements Serializable {

    private Integer id;

    private String vendor; //主机供应商

    private Cpu cpu; // 中央处理器

    private Memory memory; //内存

    private String archtecture; //架构

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Host{");
        sb.append("id=").append(id);
        sb.append(", vendor='").append(vendor).append('\'');
        sb.append(", cpu=").append(cpu);
        sb.append(", memory=").append(memory);
        sb.append(", archtecture='").append(archtecture).append('\'');
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Host host = (Host) o;
        return Objects.equals(id, host.id) &&
                Objects.equals(vendor, host.vendor);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, vendor);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getVendor() {
        return vendor;
    }

    public void setVendor(String vendor) {
        this.vendor = vendor;
    }

    public Cpu getCpu() {
        return cpu;
    }

    public void setCpu(Cpu cpu) {
        this.cpu = cpu;
    }

    public Memory getMemory() {
        return memory;
    }

    public void setMemory(Memory memory) {
        this.memory = memory;
    }

    public String getArchtecture() {
        return archtecture;
    }

    public void setArchtecture(String archtecture) {
        this.archtecture = archtecture;
    }
}
